<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
  <bean name="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
        <property name="triggers">
            <list>
            	<!--  
                <ref bean="simpleTriggerTask"/>
                <ref bean="cronTriggerTaskProcessMessage"/>
                
                <ref bean="cronTriggerContractRemind"/>
                <ref bean="cronTriggerContractDue3MonRemind"/>
                <ref bean="simpleTriggerContractDue3MonRemind"/>
                <ref bean="cronTriggerMonthMessage"/>
                <ref bean="cronTriggerWeekMessage"/>
                -->
                
                <ref bean="simpleTriggerContractRemind"/>
                
                
                <ref bean="simpleTriggerContractDue3MonRemind"/>
            </list>
        </property>
        <property name="configLocation" value="classpath:cn/ffcs/bpmpvc/quartz/quartz.properties"/>
    </bean>
    
   <!-- 使用pojo做job，指定pojo和method -->
   <bean id="jobDetailTaskMessage" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        <property name="targetObject" ref="flowPvcMessageService"/>
        <property name="targetMethod" value="sendTaskMessage"/>
   </bean>
   
   <bean id="simpleTriggerTask" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
		<property name="jobDetail" ref="jobDetailTaskMessage"/>
		<!-- 在web启动多少毫秒后启动任务 这里为5分钟-->
		<property name="startDelay" value="300000"/>
		<!-- 表示每隔多少毫秒启动 这里为20分钟-->
		<property name="repeatInterval" value="1200000"/>
   </bean>
   
   <bean id="jobDetailTaskProcessMessage" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        <property name="targetObject" ref="flowPvcMessageService"/>
        <property name="targetMethod" value="sendTaskProcessMessage"/>
   </bean>
   
   <bean id="cronTriggerTaskProcessMessage" class="org.springframework.scheduling.quartz.CronTriggerBean">
        <property name="jobDetail" ref="jobDetailTaskProcessMessage"/>
        <property name="cronExpression" value="0 0 10 ? * FRI"/>
        <!-- 在每周五上午10点触发  -->
   </bean>
   <!-- 周报 -->
   <bean id="jobDetailWeekMessage" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        <property name="targetObject" ref="flowPvcMessageService"/>
        <property name="targetMethod" value="weekReportTask"/>
   </bean>
   <bean id="cronTriggerWeekMessage" class="org.springframework.scheduling.quartz.CronTriggerBean">
        <property name="jobDetail" ref="jobDetailWeekMessage"/>
        <property name="cronExpression" value="0 0 4 ? * FRI"/>
        <!-- 在每周五上午4点触发  -->
   </bean>

	<!-- 月报 -->
   <bean id="jobDetailMonthMessage" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        <property name="targetObject" ref="flowPvcMessageService"/>
        <property name="targetMethod" value="monthReportTask"/>
   </bean>
   <bean id="cronTriggerMonthMessage" class="org.springframework.scheduling.quartz.CronTriggerBean">
        <property name="jobDetail" ref="jobDetailMonthMessage"/>
        <property name="cronExpression" value="0 0 3 27 * ?"/>
        <!-- 在每月27号上午3点触发  -->
   </bean>

	<bean id="flowPvcMessageService" parent="baseTransactionProxy">
		<property name="proxyTargetClass" value="true" />
		<property name="target">
			<bean class="cn.ffcs.bpmpvc.services.impl.FlowPvcMessageServiceImpl" autowire="byName">
				<property name="personDAO" ref="PersonDAO"/>
	 				<property name="linkMethodDAO" ref="LinkMethodDAO"/>
			</bean>
		</property>
	</bean>   
   
   <!-- 合同约束到期提醒start -->
   
   <bean id="simpleTriggerContractRemind" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
		<property name="jobDetail" ref="jobDetailContractRemind"/>
		<property name="startDelay" value="60000000"/>
		<property name="repeatInterval" value="120000"/>
		
   </bean>
    
   <bean id="cronTriggerContractRemind" class="org.springframework.scheduling.quartz.CronTriggerBean">
        <property name="jobDetail" ref="jobDetailContractRemind"/>
        <property name="cronExpression" value="0 0 2 * * ?"/>
   </bean>
   
   <bean id="jobDetailContractRemind" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        <property name="targetObject" ref="contractRemindService"/>
        <!--  
        <property name="targetMethod" value="runCondRepeatRemind"/>
        -->
        <property name="targetMethod" value="runCondRepeatRemindForBussOut"/>
   </bean>
   <!-- end -->
   
   <!-- 合同到期三个月提醒 -->
 
   <bean id="cronTriggerContractDue3MonRemind" class="org.springframework.scheduling.quartz.CronTriggerBean">
        <property name="jobDetail" ref="jobDetailContractDue3MonRemind"/>
        <property name="cronExpression" value="0 0 3 * * ?"/>
   </bean>	
   
   <bean id="simpleTriggerContractDue3MonRemind" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
		<property name="jobDetail" ref="jobDetailContractDue3MonRemind"/>
		<property name="startDelay" value="120000"/>
		<property name="repeatInterval" value="120000"/>
   </bean>
   
   <bean id="jobDetailContractDue3MonRemind" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        <property name="targetObject" ref="contractRemindService"/>
        <!--property name="targetMethod" value="runContractDue2Month"/-->
        <property name="targetMethod" value="runContractDue2MonthForBussOut"/>
   </bean>
   <!-- end -->
   
      
</beans>